<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="hh.g" %>
<%@ page contentType="text/html; charset=gb2312" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP '306c.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
 	<%!
			static ArrayList<g> goodslist=new ArrayList();/* 用来存储商品 */
			static{
				String[] names={"笔记本电脑","大衣","口红","鞋子","电视"};
				float [] prices={6666.0f,555.0f,220.2f,150.0f,2000.0f};
				for(int i=0;i<5;i++){
					g single=new g();
					single.setName(names[i]);
					single.setPrice(prices[i]);
					single.setNum(1);
					goodslist.add(i,single);
				}
			}
		 %>
		 <%
		 	session.setAttribute("goodslist",goodslist);
		 	response.sendRedirect("306.jsp");
		  %>
  </body>
</html>
